package com.company;

import com.company.strategy.type3.*;

/**
 * 游戏使用武器场景的策略模式测试代码
 */
public class TestForStrategy3 {

    public static void main(String[] args) {
        //国王角色
        Role kingRole = new KingRole();
        //用剑
        kingRole.setWeaponStrategy(new SwordStrategy());
        kingRole.display();
        kingRole.performFight();

        //切换武器，用长矛
        kingRole.setWeaponStrategy(new SpearStrategy());
        kingRole.performFight();

        System.out.println("=====================================================");

        //将军角色
        Role generalrole = new GeneralRole();
        //用斧头
        generalrole.setWeaponStrategy(new AxeStrategy());
        generalrole.display();
        generalrole.performFight();

        System.out.println("=====================================================");

        //士兵角色
        Role soldierRole = new SoldierRole();
        //用长矛
        soldierRole.setWeaponStrategy(new SpearStrategy());
        soldierRole.display();
        soldierRole.performFight();
    }
}
